// 学习元信息
// vue-4.x：
import { createRouter, createWebHistory } from 'vue-router';

const routes = [
    {
        path: "/hello-state",
        name: "hello-state",
        component: () => import("../components/09vuex/01preface/hello-state")
    },
    {
        path: "/hello-vuex",
        name: "hello-vuex",
        component: () => import("../components/09vuex/02hello-vuex/hello-vuex")
    },
    {
        path: "/map-mutations",
        name: "map-mutations",
        component: () => import("../components/09vuex/02hello-vuex/map-mutations")
    },
    {
        path: "/hello-getters",
        name: "hello-getters",
        component: () => import("../components/09vuex/03hello-getters/hello-getters")
    },
    {
        path: "/map-getters",
        name: "map-getters",
        component: () => import("../components/09vuex/03hello-getters/map-getters")
    },
    {
        path: "/hello-actions",
        name: "hello-actions",
        component: () => import("../components/09vuex/04hello-actions/hello-actions")
    },
    {
        path: "/map-actions",
        name: "map-actions",
        component: () => import("../components/09vuex/04hello-actions/map-actions")
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/hello-state'
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
});

// 导出路由对象
export default router;